home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20000824-20010305
/
000170_news@columbia.edu _Sat Dec 30 07:42:37 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@columbia.edu>
Received: from watsun.cc.columbia.edu (watsun.cc.columbia.edu [128.59.39.2])
by monire.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id HAA29035
for <kermit.misc@cpunix.cc.columbia.edu>; Sat, 30 Dec 2000 07:42:37 -0500 (EST)
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id HAA04744
for <kermit.misc@watsun.cc.columbia.edu>; Sat, 30 Dec 2000 07:42:36 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id HAA20600
for kermit.misc@watsun.cc.columbia.edu; Sat, 30 Dec 2000 07:16:29 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: Igor Sobrado <sobrado@string1.ciencias.uniovi.es>
Subject: Re: Converting struct tm to time_t
Date: 30 Dec 2000 12:15:01 GMT
Organization: Universidad de Oviedo
Message-ID: <92kjk5$66n$1@news01.si.uniovi.es>
To: kermit.misc@columbia.edu
In comp.protocols.kermit.misc Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote:
>>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:
> Russ> INN currently uses this, which seems to work fairly well. I'm
> Russ> the author of this code; you can consider it to be in the
> Russ> public domain. Note that this code requires that time_t be an
> Russ> arithmetic type, which may not work properly on some non-UNIX
> Russ> platforms (it could presumably be replaced by a long or
> Russ> something).
> heh. insert religious war about leap-second handling here :-)
> (or on second thoughts, don't)
> at least some systems have a timegm() function which is the UTC
> equivalent of mktime(). For those that don't, the straightforward
> calculation method is probably sufficient, though an alternative
> might be to do putenv("TZ=GMT0"); and then use mktime()....
In my opinion that problem should not exist in the Unix world.
The best alternative is to manage all the times in Coordinated
Universal Time and use things like the TZ environment variable
only with the library functions that show the time. In fact, this
approach avoid the need to normalize the time itself allowing a
correct data management in all the time-zones. In this sense, the
FTP server command MDTM works as expected, providing the last
modification time of a file in UTC/GMT.
By the way, MDTM should be (but is not) implemented in all the
FTP servers at present, but will be included in the next FTP RFC.
Frank, probably this fact should be checked by C-Kermit too!
Another problem, as noted by Russ Allbery is that not all the
operating systems will manage time_t in the same way as Unix.
But Unix manages both time_t and a struct tm at present making
data manipulation more complex that it should be.
Best wishes,
Igor.
--
Igor Sobrado, UK34436 - sobrado@acm.org